<?php

namespace Nim\Bundle\ModelBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * Reseller
 *
 * @ORM\Table(name="reseller")
 * @ORM\Entity
 */
class Reseller
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * @ORM\OneToMany(targetEntity="ResellerOrder", mappedBy="reseller")
     */
    private $resellerOrders;
    
    /**
     * @ORM\ManyToMany(targetEntity="Vendor", inversedBy="resellers")
     * @ORM\JoinTable(name="reseller_vendor")
     **/
    private $vendors;
    
    /**
     * @ORM\ManyToMany(targetEntity="Client", inversedBy="resellers")
     * @ORM\JoinTable(name="reseller_client")
     **/
    private $clients;
    
    public function __construct()
    {
    	$this->resellerOrders = new ArrayCollection();
    	$this->vendors = new ArrayCollection();
    	$this->clients = new ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Reseller
     */
    public function setName($name)
    {
        $this->name = $name;
    
        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Add resellerOrders
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ResellerOrder $resellerOrders
     * @return Reseller
     */
    public function addResellerOrder(\Nim\Bundle\ModelBundle\Entity\ResellerOrder $resellerOrders)
    {
        $this->resellerOrders[] = $resellerOrders;
    
        return $this;
    }

    /**
     * Remove resellerOrders
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ResellerOrder $resellerOrders
     */
    public function removeResellerOrder(\Nim\Bundle\ModelBundle\Entity\ResellerOrder $resellerOrders)
    {
        $this->resellerOrders->removeElement($resellerOrders);
    }

    /**
     * Get resellerOrders
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getResellerOrders()
    {
        return $this->resellerOrders;
    }

    /**
     * Add vendors
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Vendor $vendors
     * @return Reseller
     */
    public function addVendor(\Nim\Bundle\ModelBundle\Entity\Vendor $vendors)
    {
        $this->vendors[] = $vendors;
    
        return $this;
    }

    /**
     * Remove vendors
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Vendor $vendors
     */
    public function removeVendor(\Nim\Bundle\ModelBundle\Entity\Vendor $vendors)
    {
        $this->vendors->removeElement($vendors);
    }

    /**
     * Get vendors
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getVendors()
    {
        return $this->vendors;
    }

    /**
     * Add clients
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Client $clients
     * @return Reseller
     */
    public function addClient(\Nim\Bundle\ModelBundle\Entity\Client $clients)
    {
        $this->clients[] = $clients;
    
        return $this;
    }

    /**
     * Remove clients
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Client $clients
     */
    public function removeClient(\Nim\Bundle\ModelBundle\Entity\Client $clients)
    {
        $this->clients->removeElement($clients);
    }

    /**
     * Get clients
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getClients()
    {
        return $this->clients;
    }
}